<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title>Core JavaScript UnitTest file</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <script src="jsunittest/jsunittest.js" type="text/javascript"></script>
        <link rel="stylesheet" href="jsunittest/unittest.css" type="text/css" />
    </head>
    <body>

        <div id="content">

            <div id="header">
                <h1>Core JavaScript unit tests</h1>
                <p>
                    This file tests <strong>core javascript functionalities required by the framework.</strong>.
                </p>
            </div>

            <!-- Log output (one per Runner, via {testLog: "testlog"} option)-->
            <div id="testlog"></div>

            <!-- Put sample/test html here -->
            <div id="sample">
            </div>
        </div>

        <script type="text/javascript">
            // <![CDATA[

            var ClassThree  = function(i) {
                this.i = i;
                this.f = function() {};
            };
            
            var ClassFour  = function(i) {
                this.i = i;
            };

            ClassFour.prototype.f = function(){};

            var cfive = function(i) {
                return {i : i, f : function() {}}
            };

            var rprot = {f : function(){}};
            var csix = function(i) {
                var r = {i : i};
                r.prototype = rprot;
                return r;
            };
            
            var o = [];
            
            var max = 10000;

            console.profile('full constructor');
            for (var i = 0; i<max;i++){
                o[i] = new ClassThree(i);
            }
            console.profileEnd('full constructor');
            console.log(o.f);
            console.profile('proto constructor');
            for (var i = 0; i<max;i++){
                o[i] = new ClassFour(i);
            }
            console.profileEnd('proto constructor');
            console.log(o.f);
            console.profile('creator');
            for (var i = 0; i<max;i++){
                o[i] = cfive(i);
            }
            console.profileEnd('creator');
            console.log(o.f);
            console.profile('proto creator');
            for (var i = 0; i<max;i++){
                o[i] = csix(i);
            }
            console.profileEnd('proto creator');
            console.log(o.f);
            // ]]>
        </script>
    </body>
</html>